//
//  NetWorkingTool.h
//  LoveFreshBeen
//
//  Created by 魏根 on 2016/10/15.
//  Copyright © 2016年 魏根. All rights reserved.
//

#import "AFHTTPSessionManager.h"

typedef void (^successBlock)(id data);
typedef void (^failedBlock)(NSError *error);
typedef void (^errorBlock)(NSString *message);


@interface NetWorkingTool : AFHTTPSessionManager

@property(nonatomic,strong)NSDictionary *params;

+ (NetWorkingTool *)shareInstance;

// GET请求方法
+ (void)getUrlString:(NSString *)url
           withParam:(NSDictionary *)param
    withSuccessBlock:(successBlock)success
     withFailedBlock:(failedBlock)failed
      withErrorBlock:(errorBlock)error;

// POST请求方法
+ (void)postUrlString:(NSString *)url
            withParam:(NSDictionary *)param
     withSuccessBlock:(successBlock)success
      withFailedBlock:(failedBlock)failed
       withErrorBlock:(errorBlock)error;

- (void)getDatawithParam:(NSString *)call WithUrlString:(NSString *)url  withSuccessBlock:(successBlock)success
         withFailedBlock:(failedBlock)failed
          withErrorBlock:(errorBlock)error;
@end
